package com.cisdi.blog.service.impl;

import com.cisdi.blog.dao.UserRepository;
import com.cisdi.blog.entity.User;
import com.cisdi.blog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author pengyangyan
 * @version 1.0.0
 * @date 2020年03月18日 09:45:00
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        return userRepository.findUserByUsernameAndPassword(username,password);
    }

    @Override
    public User getUser() {
        List<User> users = userRepository.findAll();
        return users.get(0);
    }
}
